#ifndef __G_PUBLIC_H
#define __G_PUBLIC_H

#include <og/FileSystem.h>
#include <og/Plugin.h>
#include <og/Console.h>
#include <og/Shared.h>
#include <irrlicht.h>
#include <string>

#define MODULE_NAME		"gamex86.dll"

const int GAME_API_VERSION = 1;

// Renderer class in engine is derived from this abstract class
class GameRenderer
{
public:
	virtual irr::video::IImage *GetImageResource(const char *textureName) = 0;
	virtual irr::gui::IGUIFont *GetFontResource(const char *fontFileName) = 0;

	irr::gui::IGUISkin *GetCurrentSkin() { return irrGUI->getSkin(); };
	void SetCurrentSkin(irr::gui::IGUISkin *skin) { irrGUI->setSkin(skin); };

	irr::video::IVideoDriver *irrDriver;
	irr::scene::ISceneManager *irrScene;
	irr::gui::IGUIEnvironment *irrGUI;
};

// These functions are exported by the game logic DLL, to be used by the engine
class GameExport : public og::PluginExportBase
{
public:
	//This would be where we define virtual functions which use the engine

	// Shutdown, startup, and run -- the basics
	virtual void GameInit() = 0;
	virtual void GameShutdown() = 0;
	virtual void RunFrame() = 0;

	// GUI events sent from Irrlicht
	virtual void GUIEvent(int eventType, void *caller, void *element) = 0;
};

// These functions are imported by the game logic DLL, and are executed on the engine
class GameImport : public og::PluginImportBase
{
public:
	og::FileSystem *fs;
	og::CmdSystem *cmd;
	og::CVarSystem *cvar;
	GameRenderer *r;

	// This would be where we define virtual functions which are used by the engine
	virtual void Print(const char *message) = 0;
	virtual void Error(const char *message) = 0;
	virtual void UserError(og::ErrorId id, const char *msg, const char *param) = 0;
};

#endif